{
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "# Deep Belief Networks  (DBN)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "markdown",
      "source": [
        "https://github.com/albertbup/deep-belief-network"
      ],
      "metadata": {}
    },
    {
      "cell_type": "markdown",
      "source": [
        "Deep Belief Networks is a generative graphical model or class of deep neural network that control of multiple layers of hidden layers with connections between layers but not between units within each of the layer (https://en.wikipedia.org/wiki/Deep_belief_network)."
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "import numpy as np\n",
        "import matplotlib.pyplot as plt\n",
        "import pandas as pd\n",
        "\n",
        "import warnings\n",
        "warnings.filterwarnings(\"ignore\")\n",
        "\n",
        "# fix_yahoo_finance is used to fetch data \n",
        "import fix_yahoo_finance as yf\n",
        "yf.pdr_override()"
      ],
      "outputs": [],
      "execution_count": 1,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# input\n",
        "symbol = 'AMD'\n",
        "start = '2014-01-01'\n",
        "end = '2019-01-01'\n",
        "\n",
        "# Read data \n",
        "dataset = yf.download(symbol,start,end)\n",
        "\n",
        "# View Columns\n",
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "[*********************100%***********************]  1 of 1 downloaded\n"
          ]
        },
        {
          "output_type": "execute_result",
          "execution_count": 2,
          "data": {
            "text/plain": [
              "            Open  High   Low  Close  Adj Close    Volume\n",
              "Date                                                    \n",
              "2014-01-02  3.85  3.98  3.84   3.95       3.95  20548400\n",
              "2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200\n",
              "2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300\n",
              "2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100\n",
              "2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700"
            ],
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>Date</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>2014-01-02</th>\n",
              "      <td>3.85</td>\n",
              "      <td>3.98</td>\n",
              "      <td>3.84</td>\n",
              "      <td>3.95</td>\n",
              "      <td>3.95</td>\n",
              "      <td>20548400</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-03</th>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-06</th>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-07</th>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-08</th>\n",
              "      <td>4.23</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>30678700</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 2,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "dataset['Open_Close'] = (dataset['Open'] - dataset['Adj Close'])/dataset['Open']\n",
        "dataset['High_Low'] = (dataset['High'] - dataset['Low'])/dataset['Low']\n",
        "dataset['Increase_Decrease'] = np.where(dataset['Volume'].shift(-1) > dataset['Volume'],1,0)\n",
        "dataset['Buy_Sell_on_Open'] = np.where(dataset['Open'].shift(-1) > dataset['Open'],1,0)\n",
        "dataset['Buy_Sell'] = np.where(dataset['Adj Close'].shift(-1) > dataset['Adj Close'],1,0)\n",
        "dataset['Returns'] = dataset['Adj Close'].pct_change()\n",
        "dataset = dataset.dropna()\n",
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 3,
          "data": {
            "text/plain": [
              "            Open  High   Low  Close  Adj Close    Volume  Open_Close  \\\n",
              "Date                                                                   \n",
              "2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200   -0.005025   \n",
              "2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300   -0.029925   \n",
              "2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100    0.002387   \n",
              "2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700    0.011820   \n",
              "2014-01-09  4.20  4.23  4.05   4.09       4.09  30667600    0.026190   \n",
              "\n",
              "            High_Low  Increase_Decrease  Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "Date                                                                           \n",
              "2014-01-03  0.030928                  1                 1         1  0.012658  \n",
              "2014-01-06  0.047619                  1                 1         1  0.032500  \n",
              "2014-01-07  0.034063                  0                 1         0  0.012107  \n",
              "2014-01-08  0.028986                  0                 0         0  0.000000  \n",
              "2014-01-09  0.044444                  0                 0         1 -0.021531  "
            ],
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Open</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Close</th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Open_Close</th>\n",
              "      <th>High_Low</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>Date</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>2014-01-03</th>\n",
              "      <td>3.98</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>22887200</td>\n",
              "      <td>-0.005025</td>\n",
              "      <td>0.030928</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-06</th>\n",
              "      <td>4.01</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>42398300</td>\n",
              "      <td>-0.029925</td>\n",
              "      <td>0.047619</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-07</th>\n",
              "      <td>4.19</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>42932100</td>\n",
              "      <td>0.002387</td>\n",
              "      <td>0.034063</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.012107</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-08</th>\n",
              "      <td>4.23</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>30678700</td>\n",
              "      <td>0.011820</td>\n",
              "      <td>0.028986</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-09</th>\n",
              "      <td>4.20</td>\n",
              "      <td>4.23</td>\n",
              "      <td>4.05</td>\n",
              "      <td>4.09</td>\n",
              "      <td>4.09</td>\n",
              "      <td>30667600</td>\n",
              "      <td>0.026190</td>\n",
              "      <td>0.044444</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>-0.021531</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 3,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "X = np.array(dataset.drop([\"Increase_Decrease\"], axis=1))\n",
        "\nY = np.array(dataset[\"Increase_Decrease\"])"
      ],
      "outputs": [],
      "execution_count": 4,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "from sklearn.preprocessing import StandardScaler\n",
        "ss = StandardScaler()\n",
        "X = ss.fit_transform(X)"
      ],
      "outputs": [],
      "execution_count": 5,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "import tensorflow as tf"
      ],
      "outputs": [],
      "execution_count": 6,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "from dbn.tensorflow import SupervisedDBNClassification\n",
        "# from dbn import SupervisedDBNClassification\n",
        "from sklearn.model_selection import train_test_split\n",
        "from sklearn.metrics.classification import accuracy_score"
      ],
      "outputs": [],
      "execution_count": 7,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.2, random_state=0)"
      ],
      "outputs": [],
      "execution_count": 8,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "classifier = SupervisedDBNClassification(hidden_layers_structure = [256, 256],learning_rate_rbm=0.05, learning_rate=0.1, n_epochs_rbm=10,\n",
        "                                        n_iter_backprop=100, batch_size=32, activation_function='relu', dropout_p=0.2)"
      ],
      "outputs": [],
      "execution_count": 9,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "classifier.fit(X_train, Y_train)"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "[START] Pre-training step:\n",
            ">> Epoch 1 finished \tRBM Reconstruction error 6.861141\n",
            ">> Epoch 2 finished \tRBM Reconstruction error 17.113402\n",
            ">> Epoch 3 finished \tRBM Reconstruction error 52.335089\n",
            ">> Epoch 4 finished \tRBM Reconstruction error 210.406320\n",
            ">> Epoch 5 finished \tRBM Reconstruction error 577.301492\n",
            ">> Epoch 6 finished \tRBM Reconstruction error 736.563120\n",
            ">> Epoch 7 finished \tRBM Reconstruction error 1240.883380\n",
            ">> Epoch 8 finished \tRBM Reconstruction error 1808.350122\n",
            ">> Epoch 9 finished \tRBM Reconstruction error 2855.419626\n",
            ">> Epoch 10 finished \tRBM Reconstruction error 3895.758755\n",
            ">> Epoch 1 finished \tRBM Reconstruction error 956991406080.000000\n",
            ">> Epoch 2 finished \tRBM Reconstruction error 1497898024960.000000\n",
            ">> Epoch 3 finished \tRBM Reconstruction error 1896433057792.000000\n",
            ">> Epoch 4 finished \tRBM Reconstruction error 1299819659264.000000\n",
            ">> Epoch 5 finished \tRBM Reconstruction error 1867366268928.000000\n",
            ">> Epoch 6 finished \tRBM Reconstruction error 929195032576.000000\n",
            ">> Epoch 7 finished \tRBM Reconstruction error 1104877060096.000000\n",
            ">> Epoch 8 finished \tRBM Reconstruction error 1191598489600.000000\n",
            ">> Epoch 9 finished \tRBM Reconstruction error 1545590145024.000000\n",
            ">> Epoch 10 finished \tRBM Reconstruction error 1374151507968.000000\n",
            "[END] Pre-training step\n",
            "[START] Fine tuning step:\n",
            ">> Epoch 0 finished \tANN training loss 5.333668\n",
            ">> Epoch 1 finished \tANN training loss 1.254240\n",
            ">> Epoch 2 finished \tANN training loss 1.317385\n",
            ">> Epoch 3 finished \tANN training loss 0.858422\n",
            ">> Epoch 4 finished \tANN training loss 0.749344\n",
            ">> Epoch 5 finished \tANN training loss 0.741322\n",
            ">> Epoch 6 finished \tANN training loss 0.697239\n",
            ">> Epoch 7 finished \tANN training loss 0.691139\n",
            ">> Epoch 8 finished \tANN training loss 0.720673\n",
            ">> Epoch 9 finished \tANN training loss 0.692398\n",
            ">> Epoch 10 finished \tANN training loss 0.715084\n",
            ">> Epoch 11 finished \tANN training loss 0.691636\n",
            ">> Epoch 12 finished \tANN training loss 0.712471\n",
            ">> Epoch 13 finished \tANN training loss 0.744129\n",
            ">> Epoch 14 finished \tANN training loss 0.706857\n",
            ">> Epoch 15 finished \tANN training loss 0.695768\n",
            ">> Epoch 16 finished \tANN training loss 0.692531\n",
            ">> Epoch 17 finished \tANN training loss 0.706742\n",
            ">> Epoch 18 finished \tANN training loss 0.743331\n",
            ">> Epoch 19 finished \tANN training loss 0.692233\n",
            ">> Epoch 20 finished \tANN training loss 0.690345\n",
            ">> Epoch 21 finished \tANN training loss 0.698213\n",
            ">> Epoch 22 finished \tANN training loss 0.706204\n",
            ">> Epoch 23 finished \tANN training loss 0.706881\n",
            ">> Epoch 24 finished \tANN training loss 0.706705\n",
            ">> Epoch 25 finished \tANN training loss 0.714912\n",
            ">> Epoch 26 finished \tANN training loss 0.694465\n",
            ">> Epoch 27 finished \tANN training loss 0.690673\n",
            ">> Epoch 28 finished \tANN training loss 0.690362\n",
            ">> Epoch 29 finished \tANN training loss 0.696512\n",
            ">> Epoch 30 finished \tANN training loss 0.692119\n",
            ">> Epoch 31 finished \tANN training loss 0.692218\n",
            ">> Epoch 32 finished \tANN training loss 0.691557\n",
            ">> Epoch 33 finished \tANN training loss 0.710466\n",
            ">> Epoch 34 finished \tANN training loss 0.688514\n",
            ">> Epoch 35 finished \tANN training loss 0.696440\n",
            ">> Epoch 36 finished \tANN training loss 0.701672\n",
            ">> Epoch 37 finished \tANN training loss 0.693576\n",
            ">> Epoch 38 finished \tANN training loss 0.691584\n",
            ">> Epoch 39 finished \tANN training loss 0.720534\n",
            ">> Epoch 40 finished \tANN training loss 0.696276\n",
            ">> Epoch 41 finished \tANN training loss 0.689714\n",
            ">> Epoch 42 finished \tANN training loss 0.775649\n",
            ">> Epoch 43 finished \tANN training loss 0.707422\n",
            ">> Epoch 44 finished \tANN training loss 0.689223\n",
            ">> Epoch 45 finished \tANN training loss 0.691341\n",
            ">> Epoch 46 finished \tANN training loss 0.687920\n",
            ">> Epoch 47 finished \tANN training loss 0.689200\n",
            ">> Epoch 48 finished \tANN training loss 0.698444\n",
            ">> Epoch 49 finished \tANN training loss 0.697904\n",
            ">> Epoch 50 finished \tANN training loss 0.704050\n",
            ">> Epoch 51 finished \tANN training loss 0.693346\n",
            ">> Epoch 52 finished \tANN training loss 0.687985\n",
            ">> Epoch 53 finished \tANN training loss 0.694638\n",
            ">> Epoch 54 finished \tANN training loss 0.690220\n",
            ">> Epoch 55 finished \tANN training loss 0.693224\n",
            ">> Epoch 56 finished \tANN training loss 0.711879\n",
            ">> Epoch 57 finished \tANN training loss 0.692466\n",
            ">> Epoch 58 finished \tANN training loss 0.689668\n",
            ">> Epoch 59 finished \tANN training loss 0.689271\n",
            ">> Epoch 60 finished \tANN training loss 0.691861\n",
            ">> Epoch 61 finished \tANN training loss 0.698780\n",
            ">> Epoch 62 finished \tANN training loss 0.691894\n",
            ">> Epoch 63 finished \tANN training loss 0.691794\n",
            ">> Epoch 64 finished \tANN training loss 0.688251\n",
            ">> Epoch 65 finished \tANN training loss 0.688358\n",
            ">> Epoch 66 finished \tANN training loss 0.763577\n",
            ">> Epoch 67 finished \tANN training loss 0.689131\n",
            ">> Epoch 68 finished \tANN training loss 0.690760\n",
            ">> Epoch 69 finished \tANN training loss 0.695010\n",
            ">> Epoch 70 finished \tANN training loss 0.688982\n",
            ">> Epoch 71 finished \tANN training loss 0.696382\n",
            ">> Epoch 72 finished \tANN training loss 0.690119\n",
            ">> Epoch 73 finished \tANN training loss 0.690655\n",
            ">> Epoch 74 finished \tANN training loss 0.689221\n",
            ">> Epoch 75 finished \tANN training loss 0.689877\n",
            ">> Epoch 76 finished \tANN training loss 0.687909\n",
            ">> Epoch 77 finished \tANN training loss 0.688399\n",
            ">> Epoch 78 finished \tANN training loss 0.705120\n",
            ">> Epoch 79 finished \tANN training loss 0.689905\n",
            ">> Epoch 80 finished \tANN training loss 0.693611\n",
            ">> Epoch 81 finished \tANN training loss 0.687091\n",
            ">> Epoch 82 finished \tANN training loss 0.707181\n",
            ">> Epoch 83 finished \tANN training loss 0.690539\n",
            ">> Epoch 84 finished \tANN training loss 0.694665\n",
            ">> Epoch 85 finished \tANN training loss 0.691729\n",
            ">> Epoch 86 finished \tANN training loss 0.687439\n",
            ">> Epoch 87 finished \tANN training loss 0.689951\n",
            ">> Epoch 88 finished \tANN training loss 0.691619\n",
            ">> Epoch 89 finished \tANN training loss 0.687544\n",
            ">> Epoch 90 finished \tANN training loss 0.687697\n",
            ">> Epoch 91 finished \tANN training loss 0.686742\n",
            ">> Epoch 92 finished \tANN training loss 0.689141\n",
            ">> Epoch 93 finished \tANN training loss 0.689689\n",
            ">> Epoch 94 finished \tANN training loss 0.701144\n",
            ">> Epoch 95 finished \tANN training loss 0.692167\n",
            ">> Epoch 96 finished \tANN training loss 0.689044\n",
            ">> Epoch 97 finished \tANN training loss 0.690335\n",
            ">> Epoch 98 finished \tANN training loss 0.689155\n",
            ">> Epoch 99 finished \tANN training loss 0.692233\n",
            "[END] Fine tuning step\n"
          ]
        },
        {
          "output_type": "execute_result",
          "execution_count": 10,
          "data": {
            "text/plain": [
              "SupervisedDBNClassification(batch_size=32, dropout_p=0.2,\n",
              "              idx_to_label_map={0: 0, 1: 1}, l2_regularization=1.0,\n",
              "              label_to_idx_map={0: 0, 1: 1}, learning_rate=0.1,\n",
              "              n_iter_backprop=100, verbose=True)"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 10,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "code",
      "source": [
        "Y_pred = classifier.predict(X_test)\n",
        "print('Done.\\nAccuracy: %f' % accuracy_score(Y_test, Y_pred))"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Done.\n",
            "Accuracy: 0.519841\n"
          ]
        }
      ],
      "execution_count": 11,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    }
  ],
  "metadata": {
    "kernel_info": {
      "name": "python3"
    },
    "language_info": {
      "nbconvert_exporter": "python",
      "codemirror_mode": {
        "version": 3,
        "name": "ipython"
      },
      "version": "3.5.5",
      "file_extension": ".py",
      "pygments_lexer": "ipython3",
      "name": "python",
      "mimetype": "text/x-python"
    },
    "kernelspec": {
      "name": "python3",
      "language": "python",
      "display_name": "Python 3"
    },
    "nteract": {
      "version": "0.12.2"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}